package mydessertstore.web.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import java.io.IOException;

public class MyFavoriteServlet extends HttpServlet {
    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        req.setCharacterEncoding("UTF-8");
//        resp.setContentType("text/html;charset = UTF-8");
//
//        doGet(req, resp);
    }

    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        req.setCharacterEncoding("UTF-8");
//        resp.setContentType("text/html;charset = UTF-8");

//        HttpSession session = req.getSession();
//        if (session.getAttribute("listed").equals("1")){
//            session.setAttribute("listed" , "0");
//        }else{
//            session.setAttribute("listed" , "1");
//        }
//        if(session.getAttribute("page").equals("main")){
//            resp.sendRedirect("mainForm");
//        }else{
//            resp.sendRedirect("cartFormServlet");
//        }
    }
}
